package lxh.grails.basic;

def coll = [1, "bbb", "aaa"];
println coll[0]+" "+coll[-1];
println coll.join(",")
println coll.sort();
coll = coll - ["bbb"];
println coll
coll = coll + ["ccc", "ddd"];
coll.each{print it+" "}
println "------------------";


def coll2 = [];
coll2 << "bbb"
coll2.add("aaa")
coll2.add(2);
coll2[2] = 100;
println coll2.get(0)+" size is "+coll2.size();
def coll3 = coll2[1..2];
coll3.each{print it+" "}
println "";

def str = "aaabbbccc";
def str1 = str[3..6];
println str1;
str1 = str[-1..-4];
println str1;
str1 = str[3..1];
println str1;




